Automatic Inference of Necessary Preconditions
نویسندگان
چکیده
We consider the problem of automatic precondition inference. We argue that the common notion of sufficient precondition inference (i.e., under which precondition is the program correct?) imposes too large a burden on callers, and hence it is unfit for automatic program analysis. Therefore, we define the problem of necessary precondition inference (i.e., under which precondition, if violated, will the program always be incorrect?). We designed and implemented several new abstract interpretation-based analyses to infer atomic, disjunctive, universally and existentially quantified necessary preconditions. We experimentally validated the analyses on large scale industrial code. For unannotated code, the inference algorithms find necessary preconditions for almost 64% of methods which contained warnings. In 27% of these cases the inferred preconditions were also sufficient, meaning all warnings within the method body disappeared. For annotated code, the inference algorithms find necessary preconditions for over 68% of methods with warnings. In almost 50% of these cases the preconditions were also sufficient. Overall, the precision improvement obtained by precondition inference (counted as the additional number of methods with no warnings) ranged between 9% and 21%.
منابع مشابه
Typestate Inference with Preconditions
Specification inference aims to alleviate the problems inwriting specifications and missing specifications for legacy code. A common approach is to infer finite typestate automata that model legal call sequences. is yields intuitive specifications. I present a new approach that enhances the expressiveness of typestate automata by adding conditions on the parameters of each call. In addition eac...
متن کاملCyclic Abduction of Inductively Defined Safety and Termination Preconditions
We describe a new method, called cyclic abduction, for automatically inferring safety and/or termination preconditions for heap-manipulating while programs, expressed as inductive definitions in separation logic. Cyclic abduction essentially works by searching for a cyclic proof of memory safety and/or termination, abducing definitional clauses of the precondition as necessary in order to advan...
متن کاملAn Approach to Integrated Semantic Service Discovery
In a distributed service environment, service discovery is a core functionality to locate the desired services. We propose an integrated semantic service discovery approach based on ontology, which provides matching of functional and non-functional properties. Functional properties are described in terms of operations, inputs, outputs, preconditions and effects, while non-functional properties ...
متن کاملRelating Knowledge and Coordinated Action: The Knowledge of Preconditions Principle
The Knowledge of Preconditions principle (KoP) is proposed as a widely applicable connection between knowledge and action in multi-agent systems. Roughly speaking, it asserts that if some condition φ is a necessary condition for performing a given action α , then knowing φ is also a necessary condition for performing α . Since the specifications of tasks often involve necessary conditions for a...
متن کاملMining Operational Preconditions
A procedure’s client must satisfy its precondition— that is, reach a state in which the procedure may be called. Preconditions describe the state that needs to be reached, but not how to reach it. We use static analysis to infer the sequence of operations a variable goes through before being used as a parameter: “In parseProperties(String xml), the parameter xml normally stems from getPropertie...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2013